id/email
password
forgot password | create account
about | help | prefs
ReadingBatcode reading practice

 

 

String OperationsSubstr3

prev  |  next  |  chance

The first character in a string is at index 0.

public static String slice(String s) {
    int length = s.length();
    int mid = (int) (length / 2);
    return s.substring(mid);
}
Function Call  Return Value
slice("Car")
slice("Hello")
slice("556843")
slice("Elephant")
slice("Roses")

Experiment with this code on Gitpod.io

⬅ Back